
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace ComBrowser
{
	public partial class NavBookViewController : UIViewController
	{
		int SelectedBookID = 0;
		FlipperViewController flipViewController;
		#region Constructors

		// The IntPtr and initWithCoder constructors are required for controllers that need 
		// to be able to be created from a xib rather than from managed code

		public NavBookViewController (IntPtr handle) : base(handle)
		{
			Initialize ();
		}

		[Export("initWithCoder:")]
		public NavBookViewController (NSCoder coder) : base(coder)
		{
			Initialize ();
		}

		public NavBookViewController (int SelectedBookID, FlipperViewController ctrl) : base("NavBookViewController", null)
		{
			this.flipViewController = ctrl;
			this.SelectedBookID = SelectedBookID;
			Initialize ();
		}

		void Initialize ()
		{
			this.View = new NavBookView (SelectedBookID,this);
		}
		
		#endregion
		
		public void SwitchToChapterView (int zeroBasedSelectedBookID)
		{
			this.flipViewController.SwitchToChapterView (zeroBasedSelectedBookID);
		}
		
		public void CancelView ()
		{
			this.flipViewController.CancelView ();
		}
		
	}
}
